package com.example.cloudservicea.controller;


import lombok.extern.slf4j.Slf4j;
import org.lanqiao.cloudcommon.common.CommonResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RefreshScope  //动态刷新的一个开关
@RestController
public class NacosConfigController {


    @Value("${my.privateSecret}")
    String privateScrect;


    @GetMapping("/refresh")
    public CommonResult   refreshConfig(){
        log.debug("我的密钥是{}",privateScrect);
        return  CommonResult.SUCCESS("我的新密钥是",privateScrect);
    }

}
